function [GAM0,GAM1,PSI,PPI] = gammas_R(param)

phi=param(1);       % monetary pol response to infl
gamm=param(2);      % primary surplus adjustment to debt
rho_tau=param(3);   % persistence of transfer shock
rstar=param(4);     % inverse of discount factor
sigt=param(5);      % standard deviation transfer shock

ii=0;
vi=ii+1;ii=ii+1;    % nominal interest rate (r_n in the paper)
vpi=ii+1;ii=ii+1;   % inflation rate
vb=ii+1;ii=ii+1;    % real market value of debt to output (s_b in the paper)
vtau=ii+1;ii=ii+1;  % primary surplus
vt=ii+1;ii=ii+1;    % shock to transfers
%Expectation variables
jj=0;
vEpi=ii+1;ii=ii+1;jj=jj+1;   % Expected inflation
neq=ii;
nend=jj;

%Exog shock
is=0;
et=is+1;is=is+1;
nex=is;

GAM0 = zeros(neq,neq);
GAM1 = zeros(neq,neq);
PSI  = zeros(neq,nex);
PPI  = zeros(neq,nend);

%% Fisher Equation
eq=1;
GAM0(eq,vi)=1;
GAM0(eq,vEpi)=-1;

%% Monetary Rule
eq=eq+1;
GAM0(eq,vi)=1;
GAM0(eq,vpi)=-phi;

%% Govt Budget Constraint
eq=eq+1;
GAM0(eq,vtau)=rstar*(1-1/rstar);
GAM0(eq,vb)=1;
GAM1(eq,vi)= rstar;
GAM1(eq,vb)=rstar;
GAM0(eq,vpi)= rstar;


%% Fiscal Rule
eq=eq+1;
GAM0(eq,vtau)=1;
GAM1(eq,vb)=gamm;
GAM0(eq,vt)=-1;

%%Exogenous Process

% Primary surplus shocks
eq=eq+1;
GAM0(eq,vt)=1;
GAM1(eq,vt)=rho_tau;
PSI(eq,et)=sigt;

%-----------------------
% EXP ERROR output
eq=eq+1;
GAM0(eq,vpi)    = 1;
GAM1(eq,vEpi)   = 1;
PPI(eq,1) = 1;


